Repository navigation
impr(settings): re-trigger sound previews on re-click (@fehmer) - #8577
Merged
Merged
Conversation
Miodec
approved these changes
Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solves discussion #8576: in the settings sound section, clicking an already-selected sound option did nothing, so a sound could only be heard once while deciding on it.
Summary
The option button handler early-returned for the selected option, which also skipped the preview callback. Now the preview always runs; only the config write is guarded.
<Button active={config[key] === option} onClick={() => { - if (config[key] === option) return; - onOptionClick?.(option); // preview - setConfig(key, option); + const selected = config[key] === option; + onOptionClick?.(option); // always, so sounds can be re-triggered + if (!selected) setConfig(key, option); // no redundant save on re-click }}Polish in
sound-controller.ts:previewClickandpreviewErrornowstop()beforeseek(0) + play()(same pattern asplayTimeWarning), so rapid re-clicks restart the sample cleanly instead of layering.Evidence
Browser verification on the dev server with AudioContext node counters (real clicks, fresh load; the running module source was confirmed to contain the change):
beep(sample)off→"2"beep"2"beep"2"sine(oscillator)"8"sine"8"pentatonic(scale)"12"pentatonic"12"damage(error)off→"1"damage"1"No console errors, no saved-indicator flash or notifications on re-clicks.
pnpm vitest run __tests__/controllers/sound-controller.spec.ts→ 4/4 passing; oxfmt + oxlint (--type-aware --type-check) clean.Merge Danger
Door: two-way — small client-side preview tweak, trivially revertible.
Blast Radius: sound previews (settings buttons and the commandline
playactions, which sharepreviewClick/previewError). No effect on in-test click/error sounds or on config persistence.